<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 500px;
            height: 500px;
            background-color: rgb(96, 98, 98);
            
            /* 1.在父元素中设置flex布局 */
            display: flex;
            
            /* 2.默认设置主轴方向为x轴 */
            flex-direction: row;
            /* 也可以设置主轴方向为y轴或其他 */
            /* flex-direction: row-reverse; */
            /* flex-direction: column; */
            /* flex-direction: column-reverse; */
            
            /* 3.设置子元素排列方式 */
            /* 从左到右*/
            /* justify-content: flex-start; */
            /* 从右到左 */
            /* justify-content: flex-end; */
            /* 居中 */
            /* justify-content: center; */
            /* 均分剩余空间*/
            /* justify-content: space-around; */
            /* 先贴边，再均分 */
            justify-content: space-between;
        }
        div span{
            width: 100px;
            height: 100px;
            background-color: rgb(109, 140, 140);
        }
    </style>
</head>
<body>
    <div>
        <span>1</span>
        <span>2</span>
        <span>3</span>
        <span>4</span>
    </div>
</body>
</html>